package com.hurl.waguji.base.dataprocess;

import java.io.Serializable;
import java.util.Date;

import com.hurl.waguji.base.DateService;


public class ProcessParams implements Serializable{

	/**
	 * 数据产生的日期
	 */
	public static enum DateType{NOW,END_OF_PREVIOUS_SEASON,END_OF_PREVIOUS_YEAR};
	public DateType dateType;
	
	public static ProcessParams getDefault(){
		return new ProcessParams().setDateType(DateType.NOW);
	}

	public Date getRq() {
		switch(dateType){
		case NOW:
			return new Date();
		case END_OF_PREVIOUS_SEASON:
			return DateService.endOfPreviousSeason(new Date());
		case END_OF_PREVIOUS_YEAR:
			return DateService.endOfPreviousYear(new Date());
		}
		return new Date();
	}
	public ProcessParams setDateType(DateType dateType){
		this.dateType = dateType;
		return this;
	}
}
